<!--
Admin Courses
There will be one Admin Courses page. It will contain tools to help administer the course list in the Textbook Crossroads database. 

Contains:
course code form -- (department and number)
[add course]
[modify course]
[remove course]
[clear form]
-->

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html:html>
<head>
<title><bean:message key="admincourses.title"/></title>
<link rel="stylesheet" href="<%=request.getContextPath() %>/default.css" type="text/css">
<html:base/>
</head>
<body>

<div id="header">
	<div id="logo">
		<h1>
			<html:img width="40" src="../images/EMPTY.GIF"/>
			<html:link page="/pages/home.jsp">Textbook Crossroads</html:link>
		</h1>
		<h2>Team 14 - LoneTree</h2>
	</div>
	<div id="menu">
		<ul>
			<li class="active"><html:link page="/pages/admindashboard.jsp">Dashboard</html:link></li>
			<li><html:link page="/pages/books.jsp">Books</html:link></li>
			<li><html:link page="/pages/courses.jsp">Courses</html:link></li>
			<li><html:link page="/pages/about.jsp">About</html:link></li>
			<li class="logon"><html:link action="/logout">LogOut</html:link></li> 
		</ul>
	</div>
</div>

<logic:notPresent name="org.apache.struts.action.MESSAGE" scope="application">
  <font color="red">
    ERROR:  Application resources not loaded -- check servlet container
    logs for error messages.
  </font>
</logic:notPresent>

<% String add_msg = (String)request.getAttribute("course.add.message");
if(add_msg == null)
	add_msg = "";

String rem_msg = (String)request.getAttribute("course.remove.message");
if(rem_msg == null)
	rem_msg = ""; %>

<%=add_msg %><%=rem_msg %>

<div id="content">
	<div id="sidebar">
			<div id="categories">
			<div id="archives" class="boxed">
				<h2>Admin Actions</h2>
				<div class="content">
					<ul>
			    		<li><html:link href="bookadmin.jsp"><bean:message
			            key="adminbook.link"/></html:link></li>
			            
			            <li><html:link action="/AdminCourses"><bean:message
			            key="admincourses.link"/></html:link></li>
			            
			            <li><html:link action="/AdminAccounts"><bean:message
			            key="adminaccounts.link"/></html:link></li>
			            
			            <li><html:link action="/AdminComments"><bean:message
			            key="admincomments.link"/></html:link></li>
					</ul>
				</div>
			</div>
		</div>
	</div>

	<div id="posts">
		<div class="post">
			<h2 class="title"><bean:message key="admincourses.heading"/></h2>
			<div class="meta">
				<p class="date">Details:</p>
			</div>
			<div class="story">
			<ul>
				<li>
				<h3><bean:message key="admincourses.add"/></h3>
				<table border="0">
				<html:form action="AddCourse" method="post">
				<tr>
				<td><bean:message key="admincourses.addcourse.code"/></td> 
				<td><html:text property="course_code" size="4" maxlength="4" /></td>
				</tr>
				<tr>
				<td><bean:message key="admincourses.addcourse.number"/></td> 
				<td><html:text property="course_number" size="3" maxlength="3" /></td>
				</tr>
				<tr>
				<td><bean:message key="admincourses.addcourse.ctitle"/> </td>
				<td><html:text property="course_title" size="40" maxlength="50" /></td>
				<tr>
				<td><html:submit value="Add Course" /></td>
				</tr>
				</html:form>
				</table>
				</li><br/>
				
				<li>
				<h3> <bean:message key="admincourses.remove"/> </h3>
				<form action="../RemoveCourse.do">
				<bean:message key="admincourses.removecourse.txtbox"/><br>
				<input type="text" name="cidstring" size="7" maxlength="7">
				<input type="submit" value="Remove">
				</form>
				</li><br/>
				         
				<li>
				<h3> <bean:message key="admincourses.modify"/> </h3>
				<%--        
				
				pass the value in the txtbox to the next page
				
				--%>
				<form action="../SearchCourse.do"> 
				<bean:message key="admincourses.modifycourse.txtbox"/><br>
				<input type="text" name="cidstring" size="7" maxlength="7">
				<input type="submit" value="Modify">
				</form>
				</li><br/>
			</ul>		
			</div>
		</div>
	</div>
</div>

<div id="footer">
	<p id="copy">&copy;2007 LoneTree.</p>
	<p> (Andrew Lee | Bojan Martin | Dimeji Omikunle | Minghui Yu)</p>
</div>
</body>
</html:html>